﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Jair_ConsoleApplication
{
   public class LocatTimeToUTC
    {

       public static string ToUTC(double TimeZoneOffset)
       {
           int utc = 8 + Convert.ToInt32(TimeZoneOffset / 60 / 60);
           return utc.ToString("D2") + ":00";
       }

        #region 秒转换小时 SecondToHour
        /// <summary>
        /// 秒转换小时
        /// </summary>
        /// <param name="time"></param>
        /// <returns></returns>
        public static string SecondToHour(double time)
        {
            int hour = 0;
            int minute = 0;
            int second = 0;
            second = Convert.ToInt32(time);

            if (second > 60)
            {
                minute = second / 60;
                second = second % 60;
            }
            if (minute > 60)
            {
                hour = minute / 60;
                minute = minute % 60;
            }
            return (hour + "小时" + minute + "分钟"
                + second + "秒");
        }
        #endregion
    }
}
